\(\int \sqrt {a \cos ^2(x)} \, dx\) [41]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 13 \[ \int \sqrt {a \cos ^2(x)} \, dx=\sqrt {a \cos ^2(x)} \tan (x) \]

[Out]

(a*cos(x)^2)^(1/2)*tan(x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3286, 2717} \[ \int \sqrt {a \cos ^2(x)} \, dx=\tan (x) \sqrt {a \cos ^2(x)} \]

[In]

Int[Sqrt[a*Cos[x]^2],x]

[Out]

Sqrt[a*Cos[x]^2]*Tan[x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3286

Int[(u_.)*((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sin[e + f*x]^n)^FracPart[p]/(Sin[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sin[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {a \cos ^2(x)} \sec (x)\right ) \int \cos (x) \, dx \\ & = \sqrt {a \cos ^2(x)} \tan (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \sqrt {a \cos ^2(x)} \, dx=\sqrt {a \cos ^2(x)} \tan (x) \]

[In]

Integrate[Sqrt[a*Cos[x]^2],x]

[Out]

Sqrt[a*Cos[x]^2]*Tan[x]

Maple [A] (verified)

Time = 0.82 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.15

method result size
default \(\frac {a \cos \left (x \right ) \sin \left (x \right )}{\sqrt {a \left (\cos ^{2}\left (x \right )\right )}}\) \(15\)
risch \(-\frac {i \sqrt {a \left ({\mathrm e}^{2 i x}+1\right )^{2} {\mathrm e}^{-2 i x}}\, {\mathrm e}^{2 i x}}{2 \left ({\mathrm e}^{2 i x}+1\right )}+\frac {i \sqrt {a \left ({\mathrm e}^{2 i x}+1\right )^{2} {\mathrm e}^{-2 i x}}}{2 \,{\mathrm e}^{2 i x}+2}\) \(67\)

[In]

int((a*cos(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/(a*cos(x)^2)^(1/2)*a*cos(x)*sin(x)

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.15 \[ \int \sqrt {a \cos ^2(x)} \, dx=\frac {\sqrt {a \cos \left (x\right )^{2}} \sin \left (x\right )}{\cos \left (x\right )} \]

[In]

integrate((a*cos(x)^2)^(1/2),x, algorithm="fricas")

[Out]

sqrt(a*cos(x)^2)*sin(x)/cos(x)

Sympy [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.15 \[ \int \sqrt {a \cos ^2(x)} \, dx=\frac {\sqrt {a \cos ^{2}{\left (x \right )}} \sin {\left (x \right )}}{\cos {\left (x \right )}} \]

[In]

integrate((a*cos(x)**2)**(1/2),x)

[Out]

sqrt(a*cos(x)**2)*sin(x)/cos(x)

Maxima [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.46 \[ \int \sqrt {a \cos ^2(x)} \, dx=\sqrt {a} \sin \left (x\right ) \]

[In]

integrate((a*cos(x)^2)^(1/2),x, algorithm="maxima")

[Out]

sqrt(a)*sin(x)

Giac [A] (verification not implemented)

none

Time = 0.38 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.69 \[ \int \sqrt {a \cos ^2(x)} \, dx=\sqrt {a} \mathrm {sgn}\left (\cos \left (x\right )\right ) \sin \left (x\right ) \]

[In]

integrate((a*cos(x)^2)^(1/2),x, algorithm="giac")

[Out]

sqrt(a)*sgn(cos(x))*sin(x)

Mupad [B] (verification not implemented)

Time = 14.48 (sec) , antiderivative size = 46, normalized size of antiderivative = 3.54 \[ \int \sqrt {a \cos ^2(x)} \, dx=\frac {\sqrt {2}\,\sqrt {a}\,\sqrt {\cos \left (2\,x\right )+1}\,\left (\cos \left (2\,x\right )-1+\sin \left (2\,x\right )\,1{}\mathrm {i}\right )}{2\,\left (\cos \left (2\,x\right )\,1{}\mathrm {i}-\sin \left (2\,x\right )+1{}\mathrm {i}\right )} \]

[In]

int((a*cos(x)^2)^(1/2),x)

[Out]

(2^(1/2)*a^(1/2)*(cos(2*x) + 1)^(1/2)*(cos(2*x) + sin(2*x)*1i - 1))/(2*(cos(2*x)*1i - sin(2*x) + 1i))